//
//  TaskLittleView.m
//  QQplayground
//
//  Created by 王昭的Mac Air on 2018/6/12.
//  Copyright © 2018年 zhang. All rights reserved.
//

#import "TaskLittleView.h"

@implementation TaskLittleView

- (instancetype)init
{
    self = [super init];
    if (self) {
        [self configureUI];
    }
    return self;
}

- (void)configureUI
{
    [self addSubview:self.imgView];
    [_imgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.centerY.equalTo(self.mas_centerY);
        make.width.and.height.equalTo(@(14));
    }];
    
    [self addSubview:self.titleLbl];
    [_titleLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top);
        make.bottom.equalTo(self.mas_bottom);
        make.left.equalTo(self.imgView.mas_right).offset(5);
        make.right.equalTo(self.mas_right).offset(-5);
    }];
}

- (UIImageView *)imgView
{
    if (!_imgView) {
        _imgView = [[UIImageView alloc] init];
        _imgView.contentMode = UIViewContentModeScaleAspectFit;
    }
    return _imgView;
}

- (UILabel *)titleLbl
{
    if (!_titleLbl) {
        _titleLbl = [[UILabel alloc] init];
        [_titleLbl attributeFont:FontThirteen
                       textColor:UIColorFromRGB(TextSizeOneColor)
                       alignment:NSTextAlignmentLeft];
    }
    return _titleLbl;
}



@end
